@extends('layouts.app')

@section('content')


   <script src="{{ URL::asset('/') }}js/jedate/jedate.js"></script>



    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li>行政案件</li>
                <li><a href="javascript:;">查看案件</a> </li>
            </ul>
        </div>
        <div class="main-content">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#home" data-toggle="tab">修改</a></li>
            </ul>

            <div class="row">
                <div class="col-md-6">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab" class="form-horizontal" method="post">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">


                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">案件名称</label>
                                    <div class="col-sm-10">
                                      @if($case->is_ok === 1)
                                        <input type="text" class="form-control" name="case_name" id="case_name" placeholder="案件名称" value="{{$case->case_name}}" readonly>
                                      @else
                                          <input type="text" class="form-control" name="case_name" id="case_name" placeholder="案件名称" value="{{$case->case_name}}" required>
                                      @endif

                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input7" class="col-sm-2 control-label">案件类型</label>
                                    <div class="col-sm-10">

                                    @if($case->is_ok === 1)
                                    <select name="case_type" class="form-control" disabled="disabled">

                                      @foreach ($type as $key=>$type)

                                      @if($type->id === $case->case_type )
                                      <option value="{{ $type->id }}" selected="selected">{{ $type->name }}</option>
                                      @else
                                      <option value="{{ $type->id }}">{{ $type->name}}</option>
                                      @endif


                                      @endforeach

                                    </select>
                                    @else
                                    <select name="case_type" class="form-control" >


                                      @foreach ($type as $key=>$type)

                                      @if($type->id === $case->case_type )
                                      <option value="{{ $type->id }}" selected="selected">{{ $type->name }}</option>
                                      @else
                                      <option value="{{ $type->id }}">{{ $type->name}}</option>
                                      @endif


                                      @endforeach

                                    </select>
                                    @endif



                                  </div>
                                </div>

                                <div class="form-group">
                                    <label for="input2" class="col-sm-2 control-label">地址</label>
                                    <div class="col-sm-10">
                                        @if($case->is_ok === 1)
                                        <input type="text" class="form-control" name="case_company" id="case_company" placeholder="地址" value="{{$case->case_company}}" readonly>
                                          @else
                                              <input type="text" class="form-control" name="case_company" id="case_company" placeholder="地址" value="{{$case->case_company}}">
                                            @endif
                                    </div>
                                </div>


                                <div class="form-group">
                                    <label for="input7" class="col-sm-2 control-label">所属单位</label>
                                    <div class="col-sm-10">

                                      @if($case->is_ok === 1)
                                      <select name="case_address" class="form-control"  disabled="disabled">
                                        @foreach ($units as $key=>$units)

                                        @if( $units->id == $case->case_address)
                                          <option value="{{ $units->id }}" selected="selected">{{ $units->name }}</option>
                                        @else
                                          <option value="{{ $units->id }}">{{ $units->name }}</option>
                                        @endif


                                        @endforeach

                                      </select>

                                      @else

                                      <select name="case_address" class="form-control">
                                        @foreach ($units as $key=>$units)

                                        @if($units->id == $case->case_address )
                                        <option value="{{ $units->id }}" selected="selected">{{ $units->name }}</option>
                                        @else
                                          <option value="{{ $units->id }}">{{ $units->name }}</option>
                                        @endif

                                        @endforeach
                                      </select>
                                      
                                      @endif
                                  </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">整改区域</label>
                                    <div class="col-sm-10">
                                        @if($case->is_ok === 1)
                                        <input type="text" class="form-control" name="case_area" id="case_area" placeholder="整改区域" value="{{$case->case_area}}" readonly>
                                        @else
                                            <input type="text" class="form-control" name="case_area"  id="case_area" placeholder="整改区域" value="{{$case->case_area}}">
                                          @endif
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">整改项目名</label>
                                    <div class="col-sm-10">
                                        @if($case->is_ok === 1)
                                        <input type="text" class="form-control" name="case_project" id="case_project" placeholder="整改项目名" value="{{$case->case_project}}" readonly>
                                        @else
                                            <input type="text" class="form-control" name="case_project" id="case_project" placeholder="整改项目名" value="{{$case->case_project}}">
                                          @endif
                                      </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">检查时间</label>
                                    <div class="col-sm-10">
                                                @if($case->is_ok === 1)
                                              <input type="text" class="form-control" name="case_checktime" id="" placeholder="请选检查时间" value="{{$case->case_checktime}}" readonly>
                                                @else
                                              <input type="text" class="form-control" name="case_checktime" id="dateinfo" placeholder="请选检查时间" value="{{$case->case_checktime}}" readonly>
                                              @endif
                                    </div>
                                </div>





                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">详细描述</label>
                                    <div class="col-sm-10">
                                          @if($case->is_ok === 1)
                                      <textarea name="case_desc" style="margin: 0px; width: 532px; height: 248px;" readonly>{{$case->case_desc}}</textarea>
                                      @else
                                              <textarea name="case_desc" style="margin: 0px; width: 532px; height: 248px;" >{{$case->case_desc}}</textarea>
                                          @endif
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">案件添加时间时间</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="created_at" id="created_at"  value="{{$case->created_at}}" readonly>
                                    </div>
                                </div>


                                  @if ($case->is_deadline === 1)

                                  <div class="form-group">
                                      <label for="input1" class="col-sm-2 control-label" style="color:red">整改开始时间</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control"   value="{{$cd->start}}" readonly>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="input1" class="col-sm-2 control-label" style="color:red">整改预计结束时间</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control"   value="{{$cd->end}}" readonly>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="input1" class="col-sm-2 control-label" style="color:red">申请人</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control"   value="{{$cd->name}}" readonly>
                                      </div>
                                  </div>


                                  <div class="form-group">
                                      <label for="input1" class="col-sm-2 control-label" style="color:red">申请时间</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control" value="{{$cd->created_at}}" readonly>

                                      </div>
                                  </div>
                                  
                                 


                                  










                                  @endif





                                <hr/>

                                <div class="btn-toolbar list-toolbar btn-toolbar2">

                                  @if ($case->is_ok === 1)

                                    @if($case->is_deadline === 0)

                                    <a href="{{url('admin/case/no',$case->case_id)}}">
                                      <input type="button" value="限期整改" class="btn btn-primary"  style="width: 100px;">
                                    </a>
                                    @elseif($case->is_deadline === 1 && $case->is_deadlineok === 0)

                                    <a href="{{url('admin/case/dt',$case->case_id)}}">
                                      <input type="button" value="审核通过" class="btn btn-primary"  style="width: 100px;">
                                    </a>

                                    <a href="{{url('admin/case/dj',$case->case_id)}}">
                                      <input type="button" value="审核不通过" class="btn btn-primary"  style="width: 120px;">
                                    </a>

                                    @elseif($case->is_deadline === 1 && $case->is_deadlineok === 1)

                                    <a href="{{url('admin/case/lddt',$case->case_id)}}">
                                      <input type="button" value="领导审批通过" class="btn btn-primary"  style="width: 120;">
                                    </a>

                                    <a href="{{url('admin/case/lddj',$case->case_id)}}">
                                      <input type="button" value="领导审批不通过" class="btn btn-primary"  style="width: 140px;">
                                    </a>



                                    @endif




                                  @else
                                      <input type="submit" value="确认受理案件" class="btn btn-primary" id="ok">
                                  @endif


                                    <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        /*时间*/
        jeDate({
            dateCell: "#dateinfo",
            format: "YYYY-MM-DD hh:mm:ss",
            isinitVal: true,
            isTime: true, //isClear:false,
            minDate: "2014-09-19 00:00:00",
          	okfun:function(val){alert(val)}
        })
    </script>


    <script>
      $('#ok').click(function(){
          var i=window.confirm("确认受理该案件,受理后将不可修改!");
          if(i==0){
              return false;
          }
      });
    </script>


    <script type="text/javascript">
        $(function(){
            $('.valid').on('click',function(){
                if(this.checked){
                    $(this).parents('.panel').children('.panel-body').find('input').prop("checked", true);
                }else{
                    $(this).parents('.panel').children('.panel-body').find('input').prop("checked", false);
                }
            })
        })
    </script>
@stop
